<template>
  <div id="leftSide" :style="{'width':collapse?'':'240px'}">
    <el-menu
      :default-active="selNavC"
      class="el-menu-vertical-demo"
      @select="handleSelect"
      background-color="#2172ce"
      text-color="#fff"
      active-text-color="#ffd04b"
      :collapse="collapse"
    >
      <el-menu-item index="1">
        <i class="el-icon-document icon_nav"></i>
        <span slot="title">基本资料</span>
      </el-menu-item>
      <el-menu-item index="2" v-if="typeType != 2">
        <i class="el-icon-user icon_nav"></i>
        <span slot="title">企业介绍</span>
      </el-menu-item>
      <el-menu-item index="3" v-if="typeType != 2">
        <i class="el-icon-medal-1 icon_nav"></i>
        <span slot="title">业绩展示</span>
      </el-menu-item>
      <el-menu-item index="4" v-if="typeType != 2">
        <i class="el-icon-trophy icon_nav"></i>
        <span slot="title">荣誉展示</span>
      </el-menu-item>
      <el-menu-item index="5" v-if="typeType != 2">
        <i class="el-icon-help icon_nav"></i>
        <span slot="title">企业动态</span>
      </el-menu-item>
      <el-menu-item index="6" v-if="typeType != 2">
        <i class="el-icon-hot-water icon_nav"></i>
        <span slot="title">招聘信息</span>
      </el-menu-item>
    </el-menu>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: "Home",
  components: {},
  props: ["collapse"],
  data() {
    return {
      selNavC:"1",
      typeType:"1"
    };
  },
  beforeMount(){
    this.selNavC = this.$route.path.split("/Content")[1].toString();
    console.log(this.$route.query)
    if(this.$route.query.type && this.$route.query.type == 2){
       this.typeType = Number(this.$route.query.type)
    }
   
  },
  methods: {
    handleSelect(key) {
      console.log(key)
      // this.$emit("handleSelect",key, keyPath)
      this.$router.push({path:'/Content'+key})
    },
  },
};
</script>
<style scoped lang="stylus">
#leftSide {
  // width: 240px;
  border-right 1px solid #333
  box-sizing border-box
  .icon_nav {
    color: #fff;
    font-size: 22px;
  }
  .el-menu{
    border-right none
  }
}
</style>
